<template>
  <!-- 商务合作弹出框 -->
    <el-dialog
      :visible.sync="show"
      width="880px"
      custom-class="dialog footer-dialog business-dialog"
      top="0"
      :show-close="false"
      @closed="$emit('close')"
    >
      <app-link
        type="close"
        :size="20"
        class="dialog-close-btn"
        @click.native="$emit('close')"
      />
      <div class="dialog-header"><el-divider>Business hotline</el-divider></div>
      <div class="business-content">
        <div class="business-content-main">
          <div class="dialog-business-item" v-for="n in contacts" :key="n._id">
            <img class="business-image" :src="n.url" alt="商务联系人">
          </div>
        </div>
      </div>
    </el-dialog>
</template>

<script>
import ajax from '../req'

export default {
  name: 'ContactUs',
  props: {
    show: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      contacts: [{
        _id: '0',
        url: '/img/buss_contact_card.jpg'
      }, {
        _id: '0',
        url: '/img/buss_contact_card.jpg'
      }, {
        _id: '0',
        url: '/img/buss_contact_card.jpg'
      }]
    }
  },
  created () {
    ajax.getJSON('/contacts', (err, res) => {
      if (!err) {
        this.contacts = res.contacts
      }
    })
  }
}
</script>
